package binaryx

func GetState(state uint, key uint) bool {
	return state&key != 0
}

func SetState(state uint, key uint, value bool) uint {
	if value {
		state |= key
	} else {
		state &= ^key
	}
	return state
}
